const originalArray = [1, 2, 3, 4, 5];
const data = [{name: 'zs', age: 18}, {name: 'ls', age: 20}, {name: 'ww', age: 22}]

function reverseArray(arr) {
    if (Array.isArray(arr)) {
        const reversedArr = [];
        for (let i = arr.length - 1; i >= 0; i--) {
            console.log(i);
            reversedArr.push(arr[i]);
        }
        return reversedArr;
    }else {
        return arr
    }
}

console.log(reverseArray(data));

const arr = [1,2,3,4,5];
const findItemIndex = arr.indexOf(5);
console.log(findItemIndex);

let handler = {
    get(target, name) {
        console.log(name,'name',target);
      return name in target ? target[name] :  2 ** 2 ;
    },
  };
  
  let p = new Proxy({}, handler);
  p.a = 1;
  
  console.log(p.a, p.b); // 1, 42

  const array1 = [5, 12, 8, 130, 44];
console.log(array1.at(-1));
